<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ page import="weaver.interfaces.JC.GetData" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page import="weaver.general.BaseBean" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util"%>

<%
    //获取当前登录id
    String loginid = null;
    Cookie[] cookies = request.getCookies();
    for (Cookie cookie:
         cookies) {
        if ("loginidweaver".equals(cookie.getName())){
            loginid = cookie.getValue();
        }
    }
    if (loginid == null) {
        response.getWriter().write("loginid is null");
        return;
    }
    new BaseBean().writeLog("================================查询CoreMail待办数量："+loginid);
    
    RecordSet rs = new RecordSet();
   //获取当前登录人邮箱
    String sql = "select email from hrmresource where id = '"+loginid+"'";
    rs.execute(sql);
    String cut = "0";
    if(rs.next()){
        GetData gd = new GetData();
        cut = gd.getMailNum(Util.null2String(rs.getString("email")));   
    }

    PrintWriter writer = response.getWriter();
    writer.write(cut);
%>